home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / ActiveX Controlls / CD Writer Pro ActiveX Control / CD Writer Pro ActiveX Control.exe / %MAINDIR% / VBSample1 / Globals.bas < prev    next >
Encoding:
BASIC Source File  |  2003-04-16  |  6.3 KB  |  149 lines

  1. Attribute VB_Name = "Globals"
  2. Option Explicit
  3. Public Function GetTrackFileErrorMessage(ByVal FileError As CDRPROXLibCtl.eTrackFileError, ByVal FileName As String)
  4.     Dim strErrorMsg As String
  5.  
  6.     'This function will handle a track file error
  7.     Select Case FileError
  8.     Case tfeFileOpenError
  9.         strErrorMsg = "Error Opening File: " & FileName
  10.     Case tfeFileCloseError
  11.         strErrorMsg = "Error Closing File: " & FileName
  12.     Case tfeFileReadError
  13.         strErrorMsg = "Error Reading file: " & FileName
  14.     Case Else
  15.         strErrorMsg = "Unknown file error!:" & FileName
  16.     End Select
  17.  
  18.     'Return error message
  19.     GetTrackFileErrorMessage = strErrorMsg
  20. End Function
  21.  
  22. Public Function GetDriveErrorMessage(ByVal DriveError As CDRPROXLibCtl.eCDError)
  23.     
  24.     Dim strMsg As String
  25.     
  26.     'Get a String which explains the error code as explained in the help files
  27.     Select Case DriveError
  28.     Case cdNoAdditionalErrorData '1000
  29.         strMsg = "No additional error data was reported"
  30.     Case cdIOTerminated '1001
  31.         strMsg = "Abnormal I/O Termination"
  32.     Case cdLogicalUnitNotReady '1002
  33.         strMsg = "The drive is not ready"
  34.     Case cdLogicalUnitCommFailed '1003
  35.         strMsg = "Communication with drive unit failed"
  36.     Case cdDeviceTrackingError '1004
  37.         strMsg = "The drive could not track properly"
  38.     Case cdWriteGenericError '1005
  39.         strMsg = "Writing error of unknown origin"
  40.     Case cdWriteRecoveryNeeded '1006
  41.         strMsg = "Writing occurred, but recovery is needed"
  42.     Case cdWriteRecoveryFailed '1007
  43.         strMsg = "Recovery attempt failed"
  44.     Case cdWriteLossOfStreaming '1008
  45.         strMsg = "A buffer under-run has occurred"
  46.     Case cdReadUnrecovered '1009
  47.         strMsg = "The disc could not be read"
  48.     Case cdReadRetriesExhausted '1010
  49.         strMsg = "The drive's attempts at reading retries failed"
  50.     Case cdReadErrorTooLong '1011
  51.         strMsg = "The read timed out"
  52.     Case cdReadLECUncorrectable '1012
  53.         strMsg = "While reading, the LEC was not recovered"
  54.     Case cdReadCIRCUnrecovered '1013
  55.         strMsg = "The CIRC could not be validated"
  56.     Case cdReadUPCEANFailed '1014
  57.         strMsg = "Reading of the UPC failed"
  58.     Case cdReadISRCFailed '1015
  59.         strMsg = "Reading of the ISRC failed"
  60.     Case cdReadLossOfStreaming '1016
  61.         strMsg = "Streaming while reading was interrupted"
  62.     Case cdPositioningError '1017
  63.         strMsg = "Drive could not position media"
  64.     Case cdParameterListLengthError '1018
  65.         strMsg = "An incompatible parameter length was sent to the drive"
  66.     Case cdSynchronousTransferError '1019
  67.         strMsg = "A transfer error occurred to the drive"
  68.     Case cdInvalidCommandCode '1020
  69.         strMsg = "An invalid command was sent to the drive"
  70.     Case cdLBAOutOfRange '1021
  71.         strMsg = "Error trying to write past the end of the media"
  72.     Case cdInvalidCDBField '1022
  73.         strMsg = "Invalid command field"
  74.     Case cdInvalidParamterListField '1023
  75.         strMsg = "An incompatible parameter field was sent to the drive"
  76.     Case cdParameterNotSupported '1024
  77.         strMsg = "A command parameter is not supported"
  78.     Case cdParamterValueInvalid '1025
  79.         strMsg = "A command parameter had an invalid value"
  80.     Case cdBusOrDeviceReset '1026
  81.         strMsg = "The SCSI/ATAPI bus was reset and caused a write failure"
  82.     Case cdParametersChanged '1027
  83.         strMsg = "A command parameter changed while in progress"
  84.     Case cdIncompatibleMedium '1028
  85.         strMsg = "The disc is not compatible with the drive mode"
  86.     Case cdReadUnknownMediumFormat '1029
  87.         strMsg = "The drive does not recognize the format of the disc"
  88.     Case cdReadIncompatibleMediumFormat '1030
  89.         strMsg = "The disc format is not compatible with the drive"
  90.     Case cdWriteUnknownMediumFormat '1031
  91.         strMsg = "The disc is of an unknown format"
  92.     Case cdIncompatibleWriteFormat '1032
  93.         strMsg = "The drive cannot write because of an incompatible format"
  94.     Case cdMediaNotPresent '1033
  95.         strMsg = "A disc is not present"
  96.     Case cdLogicalUnitFailure '1034
  97.         strMsg = "The drive had an unknown failure"
  98.     Case cdLogicalUnitTimedOut '1035
  99.         strMsg = "The drive has timed out while completing a command"
  100.     Case cdEraseFailed '1036
  101.         strMsg = "The disc could not be erased"
  102.     Case cdUnableToRecoverTOC '1037
  103.         strMsg = "The Table of Contents is unrecoverable"
  104.     Case cdEndOfUserAreaOnTrack '1038
  105.         strMsg = "Error trying to write past the user area of the media"
  106.     Case cdPacketDoesNotFit '1039
  107.         strMsg = "Packet recording is not configured correctly"
  108.     Case cdIllegalTrackMode '1040
  109.         strMsg = "The current track mode is incompatible with the disc format"
  110.     Case cdInvalidPacketSize '1041
  111.         strMsg = "Packet recording has incorrect size"
  112.     Case cdSessionFixationError '1042
  113.         strMsg = "A generic session closing error occurred"
  114.     Case cdSessionFixationErrorLeadIn '1043
  115.         strMsg = "Error closing Lead-in area"
  116.     Case cdSessionFixationErrorLeadOut '1044
  117.         strMsg = "Error closing Lead-out area"
  118.     Case cdSessionFixationIncompleteTrack '1045
  119.         strMsg = "While closing, the track was never completed"
  120.     Case cdEmptyPartialReservedTrack '1046
  121.         strMsg = "Error attempting to write to a reserved track"
  122.     Case cdPowerCalibrationFull '1047
  123.         strMsg = "Power calibration area is full"
  124.     Case cdPowerCalibrationAreaError '1048
  125.         strMsg = "A flaw exists in the Power calibration area"
  126.     Case cdPMAUpdateFailure '1049
  127.         strMsg = "The disc's PMA could not be updated"
  128.     Case cdPMAFull '1050
  129.         strMsg = "The disc's PMA is full"
  130.     Case cdUnknownError '1051
  131.         strMsg = "Unknown error - use extended data for more information"
  132.     Case cdNoError '1052 - You will never see this most likely
  133.         strMsg = "No Error Reported"
  134.     Case cdNoSeekComplete '1053
  135.         strMsg = "A seek command was interrupted by another command"
  136.     Case cdNTIOError '1054
  137.         strMsg = "A NT disc I/O operation failed"
  138.     Case cdFormatInProgress '1055
  139.         strMsg = "A format is in progress causing operation failure"
  140.     End Select
  141.  
  142.     'return the error string
  143.     strMsg = strMsg & " (" & CStr(DriveError) & ")."
  144.  
  145.     GetDriveErrorMessage = strMsg
  146.  
  147. End Function
  148.  
  149.